<?php
/*得到活动当前文件夹名称*/
function &myGetPath(){
	static $new_path = false;
	if(empty($new_path) ){
		$path = dirname(__FILE__);
		$path_arr = explode('/',$path);
		unset($path);
		$new_path  = end($path_arr);
		unset($path_arr);
	}
	return $new_path;
}
$curr_path =  myGetPath();
load_config('xydzp_2/config');
load_config('xydzp_2/db');  //加载db的配置文件
load_config('xydzp_2/mc');  //加载memcache的配置文件
//load_config($curr_path.'/lang'); 	//加载奖品配置
load_config('lang'); 

load_library('pub:user/BDBMemberCenterEngine.inc', false);
load_library('pub:friend/FriendPassPort', false);

load_library('db');  //加载db类
load_library('text');  //加载文本处理类
load_library('mc');  //加载mc

load_helper('common');
load_helper('func');

/*截取*/
function myStrleng($str,$length,$Suffix = '...'){
	$str = trim($str);
	/*$c_leng = mb_strlen($str,'utf-8');
	if($c_leng > $length){
		$n_str = mb_substr($str, 0, $length, 'utf-8');
		return $n_str.$Suffix;
	}*/
	return $str;
}

/*帐号*/
function subAccount($account){
	$account = trim($account);
	$newStr = '';
	$_leng = mb_strlen($account,'utf-8');
	if($_leng > 3){
		$newStr = mb_substr($account,0,-3,'utf-8');
		return $newStr.'***';
	}else if($_leng == 3){
		$newStr = mb_substr($account,0,-2,'utf-8');
		return $newStr.'***';
	}else{
		return $account.'***';
	}
}
?>